<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

	
	
	
	<h:head>
	
	<h:title>FLIGHTS</h:title>
	</h:head>


<h:body>





<p:tabMenu activeIndex="0">  
    <p:menuitem value="FLIGHTS" url="http://localhost:8080/TravelDreamWeb/searchFlights.xhtml" icon="ui-icon-search"/>  
    <p:menuitem value="HOTELS" url="http://localhost:8080/TravelDreamWeb/searchHotel.xhtml" icon="ui-icon-search" />  
    <p:menuitem value="EXCURSIONS" url="http://localhost:8080/TravelDreamWeb/searchExcursions.xhtml" icon="ui-icon-search"/>  
</p:tabMenu>  





<h:form>
<h5 style="font-size:large;">FLIGHTS</h5>
    </h:form>
    
<h:form style="font-size:x-small;">
   <p:dataTable id="dataTable" var="flights" value="#{searchFlightBean.flightsList}" widgetVar="flightsListTable"   
           emptyMessage="No flights found with given criteria" filteredValue="#{searchFlightBean.flightsFiltered}"
           rowKey="#{flights.idbasicproduct}"
           selection="#{searchFlightBean.selectedFlight}"
           selectionMode="single">
          
     
        <p:column id="IDBASICPRODUCTColumn" filterBy="idbasicproduct"   
                headerText="Flight Number"
                filterMatchMode="contains"
              
                >  
            <h:outputText value="#{flights.idbasicproduct}"/>
 
 
       
      
        </p:column> 
          
        <p:column id="ARRIVALAIRPORT" filterBy="arrivalairport"  
                headerText="ARRIVAL AIRPORT" filterMatchMode="contains" >   
            <h:outputText value="#{flights.arrivalairport}" />  
        </p:column>  
  
       
                
         <p:column id="ARRIVALDATE" filterBy="arrivaldate"  
                headerText="ARRIVAL DATE"  filterMatchMode="contains">  
            <h:outputText value="#{flights.arrivaldate}" />  
        </p:column>  
         
        
         <p:column id="DEPARTUREAIRPORT" filterBy="departureairport"  
                headerText="DEPARTURE AIRPORT" filterMatchMode="contains">  
            <h:outputText value="#{flights.departureairport}" /> 
        </p:column>  
        
        
        
        
          <p:column id="DEPARTUREDATE" filterBy="departureairport"  
                headerText="DEPARTURE DATE"  filterMatchMode="contains">  
            <h:outputText value="#{flights.arrivaldate}" />  
        </p:column>     
        
        
        
        
        <p:column id="PRICE" filterBy="price"  
                headerText="PRICE" filterMatchMode="contains">  
            <h:outputText value="#{flights.price}" />  
        </p:column>
        
        
        
        
        <p:column id="SEATNUMBER" filterBy="seatnumber"  
                headerText="SEAT NUMBER"  filterMatchMode="contains">  
            <h:outputText value="#{flights.seatnumber}" />  
        </p:column>
        
        
        
    </p:dataTable>  
      
      
     
     
     
     <p:dialog header="Selected Values" modal="false" showEffect="fade" hideEffect="fade" widgetVar="dlg" closable="false" >  
        <h:panelGrid columns="2" id="display" update="dataTable">  
         <h:outputLabel value="operation succeeded, now you can view the selected package in your purchase list" />
           <p:commandButton value="Okay" update="dataTable" onclick="PF('dlg').hide()"/>
        </h:panelGrid>  
    </p:dialog>  
     
      
      
     
  
  <p:commandButton id="dynaButton" value="Actions" type="button"/>
  <p:tieredMenu overlay="true" trigger="dynaButton" my="left top" at="left bottom">
  <p:menuitem value="Purchase" action="#{searchFlightBean.purchaseFlight()}" oncomplete="PF('dlg').show()" update="display"/>  
  
 
    
  </p:tieredMenu>
         
      
      
      
      
</h:form>






</h:body>
	
	
	
	
</html>

